//2009/09/08 23:26:04
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class SlayingDeer
{
public:
    int getTime(int A, int B, int C)
    {
		for (int time = 0; time < 500000; time++)
        {
            if (C <= 0)
                return time;
            if (time % 45 < 30) 
                C += B;
            C -= A;
        }
        return -1;
    }
};
